package com.key.controller.admin.analysisReport;

import com.key.common.R;
import com.key.service.AssetTypeService;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

/*
 *
 * @author liu
 *
 */
@Controller
@RequestMapping("/asset_type")
@Api(value = "资产分类使用情况",tags = "资产分类使用情况接口API")

public class AssetTypeUseController {
    @Autowired
    private AssetTypeService assetTypeService;


    @RequestMapping(value = "/findAssetState",method = RequestMethod.GET)
    @ResponseBody
    @ApiOperation(value = "查询资产状态",notes = "查询资产状态信息回显",httpMethod = "get", response = R.class)
    @ApiResponses({
            @ApiResponse(code=200,message="成功"),
            @ApiResponse(code=401,message="token为空"),
            @ApiResponse(code=1005,message="Token过期"),
            @ApiResponse(code=1006,message="Token验证不通过"),
            @ApiResponse(code=500,message="后台服务错误")
    })
    public R findAssetState(){

        return assetTypeService.findAssetState();
    }

    @RequestMapping(value = "/findAssetTypeUse",method = RequestMethod.GET)
    @ResponseBody
    @ApiOperation(value = "查询资产分类使用情况",notes = "查询资产分类使用情况",httpMethod = "get", response = R.class)
    @ApiResponses({
            @ApiResponse(code=200,message="成功"),
            @ApiResponse(code=401,message="token为空"),
            @ApiResponse(code=1005,message="Token过期"),
            @ApiResponse(code=1006,message="Token验证不通过"),
            @ApiResponse(code=500,message="后台服务错误")
    })
    public R findAssetTypeUser(){

        return assetTypeService.findAssetTypeUse();
    }

    @RequestMapping(value = "/findAssetTypeUseByAssetTypeId",method = RequestMethod.GET)
    @ResponseBody
    @ApiOperation(value = "根据分类id查询资产分类使用情况",notes = "根据分类id查询资产分类使用情况",httpMethod = "get", response = R.class)
    @ApiImplicitParam(name = "assetTypeId",value = "资产分类Id",paramType = "query",dataType = "int",required = true)
    @ApiResponses({
            @ApiResponse(code=200,message="成功"),
            @ApiResponse(code=401,message="token为空"),
            @ApiResponse(code=1005,message="Token过期"),
            @ApiResponse(code=1006,message="Token验证不通过"),
            @ApiResponse(code=500,message="后台服务错误")
    })
    public R findAssetTypeUseByAssetTypeId(@RequestParam("assetTypeId") Integer id){

        return assetTypeService.findAssetTypeUseByAssetTypeId(id);
    }
}

